#include <stdio.h>
#define Max(a,b) ((a)>(b)?(a):(b))
int maximumLengthSubstring(char* s) {
    char countTable[128]={ [0 ... 127]=0 };    
    char *left=NULL,*right=NULL;
    left=right=s;
    int max=0;
    while( *right ){
        if( ++countTable[ *right ] > 2 ){
            --countTable[ *(left++) ];
        }else{
            max=Max(max,right-left+1);
            right++;
        }
        printf("t\n");
    }
    return max;
}

int main(){
    char *s="bcbbbcba";
    //char s[]="abcdefggg";
    printf("%d\n",maximumLengthSubstring(s));
    return 0;
}
